/**
 * @file       IInput.h
 * @brief      LCD input interface definition file
 * @author     Huabo Zheng
 * @date       Jan 12, 2012
 * @Copyright  2012, www.netgear.com Inc. All rights reserved.
 */

#ifndef IINPUT_H_
#define IINPUT_H_

namespace NS_LCD_AFW
{


class CKeyboardEvent;

/**
 *@class  IInput
 *@brief  The base class to describe as the input device
 */
class IInput
{
public:

	/**
	*@brief Constructor
	*/
	IInput();

	/**
	*@brief Constructor
	*/
	virtual ~IInput();

public:

	/**
	 *@brief  Reads a character from user input
	 *@details The function reads a character from user input and returns it as a char.
	 *@param[out] c Keyboard code
	 *@param[in]  timeout An upper bound on the amount of time elapsed in seconds before readChar() returns
	 *@exception none
	 *@retval    int
	 *@return    ERR_SUCCESS if reads successful,ERR_WAIT_TIMEOUT while timeout, other for failure
	 *@note
	 *@attention
	 *@see
	*/
	virtual int readChar(char &c,int timeout = 1) = 0;

	/**
	 *@brief  Translate  Keyboard code to the event object of framework
	 *@details
	 *@param[in] c Keyboard code
	 *@exception none
	 *@retval    CKeyboardEvent *
	 *@return    A pointer to a CKeyboardEvent object, or NULL if translate failed
	 *@note
	 *@attention
	 *@see
	*/
	virtual CKeyboardEvent *translateCodeToEvent(char c) = 0;

};

} /* namespace NS_LCD_AFW */
#endif /* IINPUT_H_ */
